module.exports = function (gulp, $, config) {
  gulp.task('replace-cdn', function(done) {
    var replace = function() {
      $.sh.sed('-i', 'lib/js/zepto.min.js', 'https://g.alicdn.com/sj/lib/zepto/zepto.min.js', 'public/index.html');
      $.sh.sed('-i', 'lib/sui/sm.min.js', 'https://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js', 'public/index.html');
      $.sh.sed('-i', 'lib/sui/sm-extend.min.js', 'https://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js', 'public/index.html');
      $.sh.sed('-i', 'lib/sui/sm-city-picker.min.js', 'https://g.alicdn.com/msui/sm/0.6.2/js/sm-city-picker.min.js', 'public/index.html');
      $.sh.sed('-i', 'lib/js/jquery.min.js', 'https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js', 'public/index.html');
      $.sh.sed('-i', 'lib/angular/angular.min.js', 'https://cdn.bootcss.com/angular.js/1.5.8/angular.min.js', 'public/index.html');
      $.sh.sed('-i', 'lib/angular/angular-ui-router.min.js', 'https://cdn.bootcss.com/angular-ui-router/0.3.1/angular-ui-router.min.js', 'public/index.html');
    }
    if(config.isProduction) {
      replace();
    }
    done();
  });
}
